@extends('main')

@section('title', '登录')

@section('sidebar')
<style type="text/css">
    .layui-btn{
        width: 100%;
        margin-left: -59px;
        margin-top: 50px;
        height: 50px;
    }
    .img{
        width: 100%;
        height: auto;
    }

</style>

<form action="{{url('login_check')}}" method="post" class="layui-form layui-form-pane">
    {{ csrf_field() }}
    <!-- <img src="/imgs/logo.png" alt="" class="img" /> -->

    <div class="layui-form-item">
        <img src="/imgs/logo.png" alt="" class="img" />
    </div>
    <div class="layui-form-item">
        <input type="text" name="phone" autocomplete="off" placeholder="请输入手机号" value="{{old('phone')}}" class="layui-input">
    </div>
    <div class="layui-form-item">
        <input type="password" name="password" autocomplete="off" placeholder="请输入密码" class="layui-input">
    </div>
    <div class="layui-form-item">
        {!! Geetest::render('popup') !!}   
    </div>
    <div class="layui-form-item">
        <div class="layui-input-block">
            <input type="submit" value="登录" class="layui-btn"/>
        </div>
    </div>
    <div class="layui-form-item">
        <a href="forget">忘记密码</a>
        <a href="register">注册</a>
    </div>   
</form>

<script type="text/javascript">
    @if (count($errors) > 0)
        layer.msg('{{ $errors->first() }}',{
            icon: 5,
            shade: [0.6, '#393D49'],
            time:1500
        });
    @endif

    @if (session('code')>1)
        layer.msg('{{ session('msg') }}',{
            icon: 5,
            shade: [0.6, '#393D49'],
            time:1500
        });
    @elseif (session('code')==1)
        window.location.href='/login';
    @endif   
</script>
@endsection